//axios基础封装
import axios from "axios";

const httpInstance = axios.create({
    baseURL: 'https://pcapi-xiaotuxian-front-devtest.itheima.net',
    timeout: 5000
})
//axios请求拦截器
httpInstance.interceptors.request.use(config => {
    //返回配置对象，headers属性请求头，Authorization属性鉴权
    return config;
}, e => Promise.reject(e))
//axios响应式拦截器
httpInstance.interceptors.response.use(res => res.data, e => Promise.reject(e))

export default httpInstance